<?php

namespace Sifast\ProjectBundle\Admin;

use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Form\FormMapper;

class ClausesContractuellesAdmin extends Admin
{
 
    protected function configureFormFields(FormMapper $formMapper)
    {
        $formMapper
        ->with('L1')
            ->add('typeContrat','text',array(
                'label'=>'Type de contact:',
            ))
             ->add('dateFin', 'date', array(
                    'label'=> 'Date de fin:',
                    'widget' => 'single_text',
                    'format' => 'MM/dd/yyyy',
                    'attr' => array('class' => 'datepicker')
                )) 
       ->end()
       ->with('L2')         
            ->add('dateDebut', 'date', array(
                    'label'=> 'Date de début:',
                    'widget' => 'single_text',
                    'format' => 'MM/dd/yyyy',
                    'attr' => array('class' => 'datepicker')
                ))
           
      ->end()      ;
            
    }

    protected function configureDatagridFilters(DatagridMapper $datagridMapper)
    {
        $datagridMapper
            ->add('typeContrat')
            ->add('dateDebut')
            ->add('dateFin')
            ;
            
    }

    protected function configureListFields(ListMapper $listMapper)
    {
        $listMapper
            ->addIdentifier('typeContrat')
            ->add('dateDebut')
            ->add('dateFin')
            ;
            
            }
}